Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to standard types, replace long types #14

Merged
merged 1 commit into from
Aug 19, 2024

Conversation

HexDecimal
Copy link
Collaborator

Includes <cstdint> and updates typedefs to point to it so that I don't need to go around the entire source and update every single type.

Replace long with int in any place where the type is used for a plain value. This clarifies that nothing is broken here.

Generally use int as the "don't care" type. int always means int32_t on modern compilers on all platforms. This is convention.

unsigned long becomes uint32_t.

printf function which was converting pointers to int to print them now uses %p instead to print the pointer directly. This might be left over debug code actually.

EffectInfo::Source is a suspicious union-like type of pointer and enum types. I used intptr_t here for comparisons to prevent truncation.

Did not touch long in preprocessor or tokenizer sources. Not much I can do with these for now.

Includes `<cstdint>` and updates typedefs to point to it so that I don't
need to go around the entire source and update every single type.

Replace `long` with `int` in any place where the type is used for a
plain value. This clarifies that nothing is broken here.

Generally use `int` as the "don't care" type. `int` always means `int32_t`
on modern compilers on all platforms. This is convention.

`unsigned long` becomes `uint32_t`.

`printf` function which was converting pointers to int to print them
now uses `%p` instead to print the pointer directly.

`EffectInfo::Source` is a suspicious union of pointer and enum types.
I used `intptr_t` here for comparisons to prevent truncation.

Did not touch `long` in preprocessor or tokenizer sources.
@rmtew rmtew merged commit f227839 into rmtew:master Aug 19, 2024
6 checks passed
@HexDecimal HexDecimal mentioned this pull request Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants